package org.obvial.obvial;

import junit.framework.TestCase;

public class CasillaTest extends TestCase {
	
	private Casilla c1;
	private Participante p1;
	private Participante p2;
	

	protected void setUp() throws Exception {
		c1 = new Casilla(1, 1, 1, 1);
		p1 = new Participante("Pepe", "Rojo", 1);
		p2 = new Participante("Manolo", "Azul", 2);
		c1.anadirParticipanteACasilla(p1);
	}

	protected void tearDown() throws Exception {
		c1 = null;
	}

	public void testGetClase(){
		assertTrue(c1.getClase() == 1);
	}
	
	public void testGetNumero() {
		assertTrue(c1.getNumero() == 1);
	}

	public void testAnadirFicha() {
		assertTrue (c1.tamano() == 1);
		c1.anadirParticipanteACasilla(p2);
		assertTrue (c1.tamano() == 2);
		c1.anadirParticipanteACasilla(p2);
		assertTrue (c1.tamano() == 2);
	}

	public void testEsta() {
		assertTrue (c1.esta(p1));
		assertFalse(c1.esta(p2));
	}

	public void testEliminarParticipanteDeCasilla() {
		c1.eliminarParticipanteDeCasilla(p1);
		assertTrue(c1.tamano() == 0);
	}

}
